package cn.initcap.access;

import cn.initcap.entity.SeckillUser;

/**
 * @author initcap
 * @date 2018/8/10 PM4:22
 */
public class UserContext {

    private static ThreadLocal<SeckillUser> userHolder = new ThreadLocal<>();

    public static SeckillUser getUser() {
        return userHolder.get();
    }

    public static void setUser(SeckillUser user) {
        userHolder.set(user);
    }

    public static void remove() {
        userHolder.remove();
    }

}
